<script setup lang="ts">
import TestPropsEmit from './components/test-props-emit/index.vue';

import {ref,onMounted} from "vue";

const msg = ref('欢迎学习vite');

const handleChange = (params: string) => {
  console.log(params);
};

const propsEmitRef = ref();

onMounted(() => {
  console.log("onMounted");
  const propsem = propsEmitRef.value;
  // console.log(propsem.child);
  propsem.childnode();
  console.log(
    document.getElementById("test")
  );
});

function created() {
  console.log("created父");
}

console.log(
  document.getElementById("test")
);

created();
</script>

<template>
  <div id="test"></div>
  <TestPropsEmit ref="propsEmitRef" :msg="msg" @on-change="handleChange"></TestPropsEmit>
</template>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
